package cn.shenshen.shop.mapper;

import cn.shenshen.shop.domain.SeckillOrder;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 秒杀订单mapper
 */
@Mapper
public interface SeckillOrderMapper {

    @Select("select * from t_seckill_order where user_id=#{userId} and good_id=#{goodId}")
     SeckillOrder find(@Param("userId") Long userId, @Param("goodId") Long goodId);

    @Insert("insert into t_seckill_order(good_id,user_id,order_no) values (#{goodId},#{userId},#{orderNo})")
    void insert(SeckillOrder seckillOrder);
}
